#include <iostream>
#include <vector>
#include <string>

using namespace std;

// https://leetcode.cn/problems/find-the-lexicographically-largest-string-from-the-box-i/?envType=daily-question&envId=2025-06-04
// 3403. 从盒子中找出字典序最大的字符串 I

class Solution
{
public:
    string answerString(string word, int numFriends)
    {
        if (numFriends == 1)
        {
            return word;
        }
        int n = word.size();
        string ans;
        for (int i = 0; i < n; i++)
        {
            ans = max(ans, word.substr(i, n - max(numFriends -1, i)));
        }
        return ans;
    }
};

int main()
{
    return 0;
}